package com.solomiao.demo.multi.thread.demo7;

public class ThreadImplementDemo7 implements Runnable {

    @Override
    public void run() {
        System.out.println("正在执行，线程：" + Thread.currentThread().getName());
        try {
            // 模拟任务执行耗时
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            System.out.println("任务 " + Thread.currentThread().getName() + " 被中断");
            Thread.currentThread().interrupt();
        }
        System.out.println("执行完毕，线程：" + Thread.currentThread().getName());
    }

}
